#ifndef DIRECTORY_H
#define DIRECTORY_H

#define MAX_CHILDREN 15
#define MAX_FILENAME_SIZE 20
#define YES 1
#define NO 0
#define VALID 1;
#define INVALID 0;

#define BUFF_SIZE 1000
#define FILE_SIZE 10*sizeof(int)
#define BLOCKS 1024/sizeof(int)

typedef struct directoryNode{
  char* name;
  int numberOfChildren;
  int inodeNumber;
  struct directoryNode* parent;
  struct directoryNode* children[MAX_CHILDREN];
}directoryNode_t;
directoryNode_t* root;

int getInodeNumber(char* path);
directoryNode_t* getDirectory(char* path);
directoryNode_t* matchDirectory(directoryNode_t*, char*);
//tree functions
directoryNode_t* getParent(directoryNode_t*);
directoryNode_t* getChild(directoryNode_t*);
void traverseDirectory(directoryNode_t*, int*, int);
//input: directory, child to be
//output: error code
int addChild(directoryNode_t*, directoryNode_t*);
//boo
//input: directory, parent to be
//output: error code
int setParent(directoryNode_t*, directoryNode_t*);
int isChild(directoryNode_t*);
//end functions

//input: none
//output: error code
int serializeDirectory(void);
int deserializeDirectory(void);

//writes a directory to disk
void writeDir(directoryNode_t*);
int charstoint(char*);
char* inttochars(int);
char* intstostring(int*);
int* stringtoints(char*);

#endif
